home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 60.zip
/
BS1 part 60
/
Kick Pascal v2.10 d2.adf
/
SYSPROG
/
ImageDemo2.p
< prev
next >
Wrap
Text File
|
1990-11-01
|
2KB
|
62 lines
Program ImageDemo2;
{ By Michael Janich & Jens Gelhar }
{ }
{ Schönere Version von "Imagedemo.p": }
{ }
{ Das Bild wird gleich 800mal ausgegeben, wobei }
{ die Positionen aus überlagerten Sinus- }
{ schwingungen berechnet werden. }
{$incl"intuition.lib" }
Type
Plane = Array[1..36] of Word; { 3*12 = 36 }
Var
Win: ^Window;
i: Integer;
x, y: Real;
Img: Image;
Dat: ^Plane;
Begin
OpenLib(IntBase,'intuition.library',0);
Win:=Open_Window(120,50,320,150,1,0,$1007,'Image',Nil,100,50,640,200);
{ Speicher für Bilddaten reservieren: }
Dat:=Ptr( Alloc_Mem(SizeOf(Plane), 2) ); { 2 = "MEMF_CHIP" }
{ Bild initialisieren: }
Dat^:=Plane(%0001111111111111, %1111111111111111, %1111111111111000,
%0111000000000000, %0000000000000000, %0000000000001110,
%1110000111111100, %0011110001111000, %0000000111100111,
%1100000111100111, %0011110000111100, %0000001111000011,
%1100000111100111, %0000000000111100, %0000001111000011,
%1100000111111100, %0111110000111100, %0011111111000011,
%1100000111100111, %0011110000111100, %0111001111000011,
%1100000111100111, %0011110000111100, %0111001111000011,
%1100000111111100, %0111111001111110, %0011111111100011,
%1110000000000000, %0000000000000000, %0000000000000111,
%0111000000000000, %0000000000000000, %0000000000001110,
%0001111111111111, %1111111111111111, %1111111111111000);
{ Image-Struktur }
Img:=Image(0,0, { keine Verschiebung }
48, { Breite }
12, { Höhe }
1, { nur eine Plane }
Dat, { Bilddaten }
1,0, { weißes Bild, schwarzer Hintergrund }
Nil); { kein weiteres Image }
For i:=0 To 800 Do { 800mal Bild ausgeben }
Begin
x:= 120*sin(i/125.66);
y:= 50*sin(i/ 31.415)
- 10*sin(i/ 62.832);
DrawImage(Win^.RPort, ^Img, 136+trunc(x), 75+round(y));
End;
Delay(5*50);
Close_Window(Win)
End.